package com.hdy.demo.tag.dao.impl;

import java.util.List;
import java.util.Map;

import com.hdy.demo.tag.dao.PagingSqlDao;
import com.hdy.demo.tag.entity.Groups;
import com.hdy.framework.hibernate.jdbc.HibernateSpringDaoSupport;
import com.hdy.login.entity.User;

/**
 * hdy
 * 2013-4-14下午9:30:00
 */
public class PagingSqlAopDaoImpl extends HibernateSpringDaoSupport implements PagingSqlDao{

	@Override
	public List<User> getUserListByPaging(int pSize, int pIdx, Map queryMap) {
		List<User> ls = this.getIbatisSqlMapClientTemplate().queryForList("DemoTag.get_user_list", queryMap);
		return ls;
	}

	@Override
	public int getCountByPaging(Map queryMap) {
		return  (Integer) this.getIbatisSqlMapClientTemplate().queryForObject("DemoTag.get_user_count", queryMap);
	}

	@Override
	public List<Groups> getGroupsList(Map<String, Object> queryMap) {
		List<Groups> ls = this.getIbatisSqlMapClientTemplate().queryForList("DemoTag.get_groups_list", queryMap);
		return ls;
	}

	@Override
	public int getGroupsCount(Map<String, Object> queryMap) {
		return  (Integer) this.getIbatisSqlMapClientTemplate().queryForObject("DemoTag.get_groups_count", queryMap);
	}


}
